package com.swd.order.vo;

public class Rets {
    public static final Integer SUCCESS = 20000;
    public static final Integer FAILURE = 9999;
    public static final Integer TOKEN_EXPIRE=50014;
    public static final Integer OUTLOGIN = 10000;
    public static final Integer NOREG = 19999;

    public static Ret success(Object data) {
        return new Ret(Rets.SUCCESS, "成功", data);
    }
    public static Ret success(Object data,String msg) {
        return new Ret(Rets.SUCCESS, msg, data);
    }


    public static Ret outLogin(){
        return new Ret(Rets.OUTLOGIN,"未登入",null);
    }

    public static Ret failure(String msg) {
        return new Ret(Rets.FAILURE, msg, null);
    }

    public static Ret failure() {
        return new Ret(Rets.FAILURE,null, null);
    }

    public static Ret success() {
        return new Ret(Rets.SUCCESS, "成功", null);
    }

    public static Ret expire(){
        return new Ret(Rets.TOKEN_EXPIRE,"token 过期",null);
    }

    public static Ret noReg(String openId){
        return new Ret(Rets.NOREG,"",openId);
    }
}
